﻿using CZBK.ShopHeima2.DAL;
using CZBK.ShopHeima2.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CZBK.ShopHeima2.IBLL
{
    public interface IBaseService<T> where T : class ,new()
    {
        IDbSession DbSession { get; }

       



        # region 查询和分页
         IEnumerable<T> LoadAllEntities(Func<T, bool> whereLambda);

       IEnumerable<T> LoadAllPageEntities<S>(int pageIndex, int pageSize, Func<T, bool> whereLambda, Func<T, S> orderByLambda, bool isAsc);
        #endregion

        #region cud
         T AddEntity(T entity);

         bool UpdateEntity(T entity);

        bool DeleteEntity(int id);

        #endregion


        int ExecuteSql(string strSql, System.Data.SqlClient.SqlParameter[] paras);
         int SavaChanges();
    }
}
